package com.codexsoft.test;

import org.apache.wicket.extensions.wizard.Wizard;
import org.apache.wicket.markup.html.link.Link;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 25.08.11
 * Time: 14:07
 * To change this template use File | Settings | File Templates.
 */
public final class WizardLink extends Link {
    private final Class<? extends Wizard> wizardClass;

    /**
     * Construct.
     *
     * @param <C>
     * @param id          Component id
     * @param wizardClass Class of the wizard to instantiate
     */
    public <C extends Wizard> WizardLink(String id, Class<C> wizardClass) {
        super(id);
        this.wizardClass = wizardClass;
    }

    /**
     * @see org.apache.wicket.markup.html.link.Link#onClick()
     */
    @Override
    public void onClick() {
        setResponsePage(new WizardPage(wizardClass));
    }
}
